< previous page page_448 next page >

Page 448
handling routine itself, Visual Basic will search the calls list for another enabled error-handling routine. The calls list is the sequence of calls that leads to the currently executing procedure. To display the calls list yourself (see Figure 16.1), choose View, Call Stack from the menu.
12181-0448a.gif
Figure 16.1.
Viewing the list of procedures in the calls
stack when an error occurs.
Note
The calls stack is only available when the program is halted because of an error, or because a breakpoint has been set.

To understand how this all works, suppose the following sequence of calls has been made in your application as shown in Figure 16.2. The order of execution is listed here:
1. A command button click event calls subroutine A.
2. Subroutine A then makes a call to Function B.
3. Function B calls subroutine C.
12181-0448b.gif
Figure 16.2.
A visual diagram of a calls stack list.
Whichever routine is currently processing, the routines that proceed it are pending, waiting for control to be returned to them. Now, if an error occurs in subroutine C and an

 
< previous page page_448 next page >

If you like this book, buy it!